/* 苹果星云主题样式 */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1f2428;
    --bg-quaternary: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #484f58;
    --accent: #58a6ff;
    --accent-secondary: #388bfd;
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --border: rgba(240, 246, 252, 0.1);
    --card-bg: rgba(31, 36, 40, 0.8);
    --card-hover: rgba(39, 44, 48, 0.8);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(88, 166, 255, 0.15), transparent 50%),
                      radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.15), transparent 50%);
    background-attachment: fixed;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    transition: transform 0.3s ease;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    font-weight: 500;
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    transition: margin-left 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background-color 0.2s ease;
    backdrop-filter: blur(8px);
}

.card:hover {
    transform: translateY(-2px);
    background-color: var(--card-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* 作品卡片样式 */
.work-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.work-card:hover {
    transform: translateY(-2px);
    background-color: var(--card-hover);
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.work-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.work-description {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.work-meta {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.work-meta a {
    color: var(--accent);
    text-decoration: none;
}

.work-meta a:hover {
    text-decoration: underline;
}

.work-image img {
    border-radius: 4px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-secondary);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-quaternary);
}

.btn-danger {
    background-color: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background-color: #da3633;
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background-color: #30a14e;
}

.btn-warning {
    background-color: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background-color: #b58900;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.tab.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* 状态提示样式 */
.status {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.status.show {
    opacity: 1;
    transform: translateY(0);
}

.status-success {
    background-color: rgba(63, 185, 80, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.status-error {
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

.status-warning {
    background-color: rgba(210, 153, 34, 0.1);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.status-loading {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border-left: 4px solid var(--accent);
}

/* 加载动画 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式样式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card {
        padding: 16px;
    }
}

/* 帖子编辑器样式 */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.editor-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.editor-tab.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.editor-content {
    flex: 1;
    min-height: 400px;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
    resize: none;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.preview-content {
    flex: 1;
    min-height: 400px;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
    overflow-y: auto;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.login-form {
    text-align: left;
}

.login-btn {
    width: 100%;
    margin-top: 16px;
}

/* 帖子列表样式 */
.post-list {
    margin-top: 24px;
}

.post-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    background-color: var(--card-hover);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.post-title {
    font-weight: 600;
    color: var(--text-primary);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.post-actions {
    display: flex;
    gap: 8px;
}

/* 分区管理样式 */
.partition-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.partition-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.partition-card:hover {
    transform: translateY(-2px);
    background-color: var(--card-hover);
}

.partition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.partition-title {
    font-weight: 600;
    color: var(--text-primary);
}

.partition-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.partition-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 顶部操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 8px 12px;
    width: 300px;
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 8px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    flex: 1;
}

/* 生成内容按钮组 */
.generate-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* 全屏编辑模式 */
.fullscreen-editor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.fullscreen-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.fullscreen-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 占位符样式 */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary);
    text-align: center;
}

.placeholder i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 代码高亮样式 */
code {
    background-color: rgba(27, 31, 35, 0.5);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
}

/* 通知徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--accent);
    color: #fff;
}

.badge-success {
    background-color: var(--success);
    color: #fff;
}

.badge-warning {
    background-color: var(--warning);
    color: #fff;
}

.badge-danger {
    background-color: var(--error);
    color: #fff;
}

/* 开关按钮样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-quaternary);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 帖子编辑器预览区域样式补充 */
.preview-content h1, .preview-content h2, .preview-content h3, .preview-content h4, .preview-content h5, .preview-content h6 {
    color: var(--accent);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.preview-content p {
    margin-bottom: 1em;
}

.preview-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.preview-content em {
    font-style: italic;
    color: var(--text-primary);
}

.preview-content a {
    color: var(--accent);
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

/* 自定义滚动条样式 */
/* 滚动条整体 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
    background: var(--bg-quaternary);
    border-radius: 4px;
    transition: background 0.2s ease;
}

/* 滚动条滑块悬停 */
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* 分区列表滚动条优化 */
.partition-list {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-quaternary) var(--bg-tertiary);
}

/* 模态框滚动条优化 */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-quaternary) var(--bg-tertiary);
}

/* 侧边栏滚动条优化 */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-quaternary) var(--bg-secondary);
}

/* Firefox 滚动条样式 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-quaternary) var(--bg-tertiary);
}